/*
 * @Author: szx
 * @Date: 2022-02-25 13:07:12
 * @LastEditTime: 2022-02-25 13:09:41
 * @Description:
 * @FilePath: \leetcode\1900-1999\1979\1979.js
 */
/**
 * @param {number[]} nums
 * @return {number}
 */
var findGCD = function (nums) {
    const max = Math.max(...nums);
    const min = Math.min(...nums);
    return gcd(max, min);
};

const gcd = (a, b) => {
    if (b === 0) return a;
    return gcd(b, a % b);
};
